package mil.af.amc.adpetracker.model.comparators;


import org.springframework.security.core.GrantedAuthority;

import java.util.Comparator;

/**
 * Please fill in this Javadoc
 *
 * @author Jason Ferguson
 */
public class GrantedAuthorityRoleComparator implements Comparator<GrantedAuthority> {

    public int compare(GrantedAuthority o1, GrantedAuthority o2) {

        // This works because the roles alphabetical order is exactly opposite of the
        // priority of the roles... dirty hack, but it should work for now
        return o1.getAuthority().compareTo(o2.getAuthority());
    }

}
